﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace weighing
{
    public class Int2VisiblityConverter : System.Windows.Data.IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var res = (int)value == 1 ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
            return res;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var res = (System.Windows.Visibility)value == System.Windows.Visibility.Visible ? 1 : 0;
            return res;
        }
    }
}
